<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.9.1"/>
<title>IDA SDK: bitrange_t Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { init_search(); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">IDA SDK
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.9.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="files.html"><span>Header&#160;Files</span></a></li>
      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="annotated.html"><span>Class&#160;List</span></a></li>
      <li><a href="classes.html"><span>Class&#160;Index</span></a></li>
      <li><a href="hierarchy.html"><span>Class&#160;Hierarchy</span></a></li>
      <li><a href="functions.html"><span>Class&#160;Members</span></a></li>
    </ul>
  </div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="classbitrange__t-members.html">List of all members</a>  </div>
  <div class="headertitle">
<div class="title">bitrange_t Class Reference</div>  </div>
</div><!--header-->
<div class="contents">
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>This class manages the offset and size of a value that occupies a number of contiguous bits within some container - generally a byte array. </p>
<p>A special state - empty range (both offset and size are zeroes) - determines the value as all bits of the container. </p>
</div><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:ab27da7389c0616c8f2003640a42d80dc"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ab27da7389c0616c8f2003640a42d80dc"></a>
&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbitrange__t.html#ab27da7389c0616c8f2003640a42d80dc">bitrange_t</a> (<a class="el" href="pro_8h.html#a05f6b0ae8f6a6e135b0e290c25fe0e4e">uint16</a> bit_ofs=0, <a class="el" href="pro_8h.html#a05f6b0ae8f6a6e135b0e290c25fe0e4e">uint16</a> size_in_bits=0)</td></tr>
<tr class="memdesc:ab27da7389c0616c8f2003640a42d80dc"><td class="mdescLeft">&#160;</td><td class="mdescRight">Constructor. <br /></td></tr>
<tr class="separator:ab27da7389c0616c8f2003640a42d80dc"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af8fb71b6bc4ef1f4f6eba8c8386b32c0"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="af8fb71b6bc4ef1f4f6eba8c8386b32c0"></a>
void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbitrange__t.html#af8fb71b6bc4ef1f4f6eba8c8386b32c0">init</a> (<a class="el" href="pro_8h.html#a05f6b0ae8f6a6e135b0e290c25fe0e4e">uint16</a> bit_ofs, <a class="el" href="pro_8h.html#a05f6b0ae8f6a6e135b0e290c25fe0e4e">uint16</a> size_in_bits)</td></tr>
<tr class="memdesc:af8fb71b6bc4ef1f4f6eba8c8386b32c0"><td class="mdescLeft">&#160;</td><td class="mdescRight">Initialize offset and size to given values. <br /></td></tr>
<tr class="separator:af8fb71b6bc4ef1f4f6eba8c8386b32c0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af7f962852013d6eb3037a449a0c9e8b4"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="af7f962852013d6eb3037a449a0c9e8b4"></a>
void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbitrange__t.html#af7f962852013d6eb3037a449a0c9e8b4">reset</a> ()</td></tr>
<tr class="memdesc:af7f962852013d6eb3037a449a0c9e8b4"><td class="mdescLeft">&#160;</td><td class="mdescRight">Make the bitrange empty. <br /></td></tr>
<tr class="separator:af7f962852013d6eb3037a449a0c9e8b4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5e6117ca71e33e5c91e36b6a77b60650"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a5e6117ca71e33e5c91e36b6a77b60650"></a>
bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbitrange__t.html#a5e6117ca71e33e5c91e36b6a77b60650">empty</a> () const </td></tr>
<tr class="memdesc:a5e6117ca71e33e5c91e36b6a77b60650"><td class="mdescLeft">&#160;</td><td class="mdescRight">Is the bitrange empty? <br /></td></tr>
<tr class="separator:a5e6117ca71e33e5c91e36b6a77b60650"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5b707c159dbd4c092f4e6ab4028df6ee"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a5b707c159dbd4c092f4e6ab4028df6ee"></a>
<a class="el" href="pro_8h.html#a91ad9478d81a7aaf2593e8d9c3d06a14">uint</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbitrange__t.html#a5b707c159dbd4c092f4e6ab4028df6ee">bitoff</a> () const </td></tr>
<tr class="memdesc:a5b707c159dbd4c092f4e6ab4028df6ee"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get offset of 1st bit. <br /></td></tr>
<tr class="separator:a5b707c159dbd4c092f4e6ab4028df6ee"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8b59cbec950903acff1806e9c2ad652f"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a8b59cbec950903acff1806e9c2ad652f"></a>
<a class="el" href="pro_8h.html#a91ad9478d81a7aaf2593e8d9c3d06a14">uint</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbitrange__t.html#a8b59cbec950903acff1806e9c2ad652f">bitsize</a> () const </td></tr>
<tr class="memdesc:a8b59cbec950903acff1806e9c2ad652f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get size of the value in bits. <br /></td></tr>
<tr class="separator:a8b59cbec950903acff1806e9c2ad652f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a889c371c830116afd554da378348debf"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a889c371c830116afd554da378348debf"></a>
<a class="el" href="pro_8h.html#a91ad9478d81a7aaf2593e8d9c3d06a14">uint</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbitrange__t.html#a889c371c830116afd554da378348debf">bytesize</a> () const </td></tr>
<tr class="memdesc:a889c371c830116afd554da378348debf"><td class="mdescLeft">&#160;</td><td class="mdescRight">Size of the value in bytes. <br /></td></tr>
<tr class="separator:a889c371c830116afd554da378348debf"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aec95fa885f5c2b5979c7c5ea1563ff6a"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aec95fa885f5c2b5979c7c5ea1563ff6a"></a>
<a class="el" href="pro_8h.html#a2f5563986d7f95e4fad5876c17d9cdda">uint64</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbitrange__t.html#aec95fa885f5c2b5979c7c5ea1563ff6a">mask64</a> () const </td></tr>
<tr class="memdesc:aec95fa885f5c2b5979c7c5ea1563ff6a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Convert to mask of 64 bits. <br /></td></tr>
<tr class="separator:aec95fa885f5c2b5979c7c5ea1563ff6a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a506620bff47b52c6efd4fcddc5048925"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a506620bff47b52c6efd4fcddc5048925"></a>
bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbitrange__t.html#a506620bff47b52c6efd4fcddc5048925">combine</a> (const <a class="el" href="classbitrange__t.html">bitrange_t</a> &amp;subrange)</td></tr>
<tr class="memdesc:a506620bff47b52c6efd4fcddc5048925"><td class="mdescLeft">&#160;</td><td class="mdescRight">Make the superposition of the current bitrange and given bitrange. <br /></td></tr>
<tr class="separator:a506620bff47b52c6efd4fcddc5048925"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:afd4dccf7dde35528485e54872f44fde3"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="afd4dccf7dde35528485e54872f44fde3"></a>
void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbitrange__t.html#afd4dccf7dde35528485e54872f44fde3">intersect</a> (const <a class="el" href="classbitrange__t.html">bitrange_t</a> &amp;r)</td></tr>
<tr class="memdesc:afd4dccf7dde35528485e54872f44fde3"><td class="mdescLeft">&#160;</td><td class="mdescRight">Intersect two ranges. <br /></td></tr>
<tr class="separator:afd4dccf7dde35528485e54872f44fde3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:afa4df9f99135a4ec855b2bade986d4ad"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="afa4df9f99135a4ec855b2bade986d4ad"></a>
void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbitrange__t.html#afa4df9f99135a4ec855b2bade986d4ad">create_union</a> (const <a class="el" href="classbitrange__t.html">bitrange_t</a> &amp;r)</td></tr>
<tr class="memdesc:afa4df9f99135a4ec855b2bade986d4ad"><td class="mdescLeft">&#160;</td><td class="mdescRight">Create union of 2 ranges including the hole between them. <br /></td></tr>
<tr class="separator:afa4df9f99135a4ec855b2bade986d4ad"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a518c3a49d84356c6c29052a3503bbce0"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a518c3a49d84356c6c29052a3503bbce0"></a>
void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbitrange__t.html#a518c3a49d84356c6c29052a3503bbce0">shift_down</a> (<a class="el" href="pro_8h.html#a91ad9478d81a7aaf2593e8d9c3d06a14">uint</a> cnt)</td></tr>
<tr class="memdesc:a518c3a49d84356c6c29052a3503bbce0"><td class="mdescLeft">&#160;</td><td class="mdescRight">Shift range down (left) <br /></td></tr>
<tr class="separator:a518c3a49d84356c6c29052a3503bbce0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6b6889b1e0a6a5cd3b84213f52d71747"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a6b6889b1e0a6a5cd3b84213f52d71747"></a>
void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbitrange__t.html#a6b6889b1e0a6a5cd3b84213f52d71747">shift_up</a> (<a class="el" href="pro_8h.html#a91ad9478d81a7aaf2593e8d9c3d06a14">uint</a> cnt)</td></tr>
<tr class="memdesc:a6b6889b1e0a6a5cd3b84213f52d71747"><td class="mdescLeft">&#160;</td><td class="mdescRight">Shift range up (right) <br /></td></tr>
<tr class="separator:a6b6889b1e0a6a5cd3b84213f52d71747"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af8ad6e100eec0e3167b9cfc642377943"><td class="memTemplParams" colspan="2"><a class="anchor" id="af8ad6e100eec0e3167b9cfc642377943"></a>
template&lt;class T &gt; </td></tr>
<tr class="memitem:af8ad6e100eec0e3167b9cfc642377943"><td class="memTemplItemLeft" align="right" valign="top">void&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="classbitrange__t.html#af8ad6e100eec0e3167b9cfc642377943">assign_max_nonzero</a> (T mask)</td></tr>
<tr class="memdesc:af8ad6e100eec0e3167b9cfc642377943"><td class="mdescLeft">&#160;</td><td class="mdescRight">Initialize <a class="el" href="classbitrange__t.html" title="This class manages the offset and size of a value that occupies a number of contiguous bits within so...">bitrange_t</a> with offset/size defined by given mask. <br /></td></tr>
<tr class="separator:af8ad6e100eec0e3167b9cfc642377943"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr><td colspan="2"><div class="groupHeader">Extract</div></td></tr>
<tr><td colspan="2"><div class="groupText"><p>Extract a value from 'src' according to the bitrange</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">dst</td><td>vector the extracted value will be stored to </td></tr>
    <tr><td class="paramname">src</td><td>source buffer </td></tr>
    <tr><td class="paramname">src_size</td><td>size of source buffer </td></tr>
    <tr><td class="paramname">is_mf</td><td>is Msb First? (TRUE-big endian, FALSE-little endian) </td></tr>
  </table>
  </dd>
</dl>
</div></td></tr>
<tr class="memitem:aae93b1dda7b76bcb8cc9904b3372a75b"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aae93b1dda7b76bcb8cc9904b3372a75b"></a>
bool&#160;</td><td class="memItemRight" valign="bottom"><b>extract</b> (<a class="el" href="classbytevec__t.html">bytevec_t</a> *dst, const void *src, size_t src_size, bool is_mf) const </td></tr>
<tr class="separator:aae93b1dda7b76bcb8cc9904b3372a75b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a010608d468a40f00e49d3a5e8071a29e"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a010608d468a40f00e49d3a5e8071a29e"></a>
bool&#160;</td><td class="memItemRight" valign="bottom"><b>extract</b> (void *dst, size_t dst_size, const void *src, size_t src_size, bool is_mf) const </td></tr>
<tr class="separator:a010608d468a40f00e49d3a5e8071a29e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr><td colspan="2"><div class="groupHeader">Inject</div></td></tr>
<tr><td colspan="2"><div class="groupText"><p>Inject a value into 'dst' according to the bitrange</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">dst</td><td>a buffer the value will be injected into </td></tr>
    <tr><td class="paramname">dst_size</td><td>size of buffer </td></tr>
    <tr><td class="paramname">src</td><td>source value </td></tr>
    <tr><td class="paramname">is_mf</td><td>is Msb First? (TRUE-big endian, FALSE-little endian) </td></tr>
  </table>
  </dd>
</dl>
</div></td></tr>
<tr class="memitem:a5155f8a282671486892e4757ca04ca0e"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a5155f8a282671486892e4757ca04ca0e"></a>
bool&#160;</td><td class="memItemRight" valign="bottom"><b>inject</b> (void *dst, size_t dst_size, const void *src, size_t src_size, bool is_mf) const </td></tr>
<tr class="separator:a5155f8a282671486892e4757ca04ca0e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3e6a183bfe59d4a5cf1377115903b3a0"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a3e6a183bfe59d4a5cf1377115903b3a0"></a>
bool&#160;</td><td class="memItemRight" valign="bottom"><b>inject</b> (void *dst, size_t dst_size, const <a class="el" href="classbytevec__t.html">bytevec_t</a> &amp;src, bool is_mf) const </td></tr>
<tr class="separator:a3e6a183bfe59d4a5cf1377115903b3a0"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<hr/>The documentation for this class was generated from the following file:<ul>
<li><a class="el" href="bitrange_8hpp.html">bitrange.hpp</a></li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.9.1
</small></address>
</body>
</html>
